package com.example.springbootjpasqllogdemo.common.config;

import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.persistence.EntityManager;

/**
 * jpa增强插件配置类
 *
 * @author Lv
 * @date 2022/11/4
 */
@Configuration
public class JpaConfig {
    /**
     * jpa增强插件
     *
     * @param entityManager 实体模型管理对象
     * @return
     */
    @Bean
    public JPAQueryFactory jpaQueryFactory(EntityManager entityManager) {
        return new JPAQueryFactory(entityManager);
    }
}
